home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Shells / bsh.lzh / bsh / fact < prev    next >
Encoding:
Text File  |  1993-02-14  |  415 b   |  14 lines

  1. if argv[1]>1
  2.     return argv[1]*fact(argv[1]-1)
  3. else
  4.     return 1
  5. endif
  6. # fact - recursive calculation of factorial function.  To run, type:
  7. #    eval fact(6)
  8. # or some other number.
  9. #
  10. # Fact is presented as is; no warrantee is either expressed or implied
  11. # as to it's suitability to any purpose whatsoever.  You assume all the
  12. # risk for all damage, even if caused by a defect in the software,
  13. # no matter how awful.
  14.